package org.personal.jdbc;

import java.util.Properties;

public class JdbcTemplate {
	
	private static ConnectionManager cm=null;
	
	/** 构造方法
	 * @param porp 
	 */
	public JdbcTemplate(Properties porp){
		if(cm==null){System.out.println("初始化过静态属性");
			cm=new ConnectionManager(porp);
		}
	}
	/**
	 * @return
	 */
	public PreparedStatement getPreparedStatement(){
		return new PreparedStatement(cm.getConnection());
	}
	
	/**
	 * @return
	 */
	public PreparedStatementSupport getPreparedStatementSupport(){
		return new PreparedStatementSupport(cm.getConnection());
	}
	
	/**
	 * @return
	 */
	public Statement getStatement(){
		return new Statement(cm.getConnection());
	}
	
	/**
	 * @return
	 */
	public StatementSupport getStatementSupport(){
		return new StatementSupport(cm.getConnection());
	}
	
}
